﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GastoObraReadForm.aspx.cs" 
Inherits="UILGestion.ObraAdmin.OrdenCompras.GastoObraReadForm" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register src="../../AlmacenAdmin/NotaIngresoListGrid.ascx" tagname="NotaIngresoListGrid" tagprefix="uc5" %>
<%@ Register src="~/Control/menuObraCtrl.ascx" tagname="menuObraCtrl" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Orden de Compra</title>
       <link href="../../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../../css/default.css" rel="stylesheet" type="text/css" />
         <link href="../../css/main.css" rel="stylesheet" type="text/css" />

          <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />
         <script type="text/javascript">
<!--

             
             function goPage() {

                 var idObra = document.getElementById("idObra").value;
                 var internalid = document.getElementById("internalid").value;
                 window.open('../../Rpt/PrintForm.aspx?type=GASTOOBRA&id=' +
        internalid.toString());
             }
-->
</script>

    <script src="../../Scripts/SearchResult.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <uc1:menuObraCtrl ID="menuObraCtrl1" runat="server" />
     <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"  EnablePartialRendering="true">
    </asp:ToolkitScriptManager>

    
   <asp:Panel ID="pnlMain" runat="server"
   Visible="false"
                CssClass="Heading secTitle AreaHeading ms-crm-List-Header "  >
<asp:Label ID="Label1" runat="server" Text="GASTO DE OBRA" 
            style="font-size: large; color: #960818"></asp:Label>
</asp:Panel>
  <asp:Panel ID="PanelButtom" runat="server" Visible="false"    class="ms-crm-Form-Body" >


                 <table  width="100%">
                 <tr>
                 <td  width="80%">
                 
                   <table >
<tr>
<td>
    <asp:Button ID="refreshButton" runat="server" Text="Restablecer"  CssClass="ms-crm-List-Header" 
        onclick="saveButton_Click"   OnClientClick="return confirm('Usted quiere Guardar?')" /></td>

<td>
    <asp:Button ID="nuevoButton" runat="server" Text="Nuevo" CssClass="ms-crm-List-Header" 
        onclick="saveButton_Click"  /></td>


<td>
    <asp:Button ID="aprobarBTN" runat="server" Text="Aprobar"  CssClass="ms-crm-List-Header" 
     OnClientClick="return confirm('Usted quiere aprobar ?')"
      onclick="saveButton_Click" 
        /></td> 

 <td>
    <asp:Button ID="EliminarButton" runat="server" Text="Eliminar"  CssClass="ms-crm-List-Header" 
     OnClientClick="return confirm('Usted quiere eliminar?')"
      onclick="saveButton_Click" 
        /></td> 

        

 <td>

 


        <%--
          <asp:HyperLink runat= "server"           Text="Imprimir"   Target="_blank"  ID="OrdenCompra" l
                NavigateUrl='<%# "../Rpt/PrintForm.aspx?idOrdenCompra=" + internalid.Value+ 
                 "&idObra=" + idObra.Value%>' 
               />   
--%>
        </td>
        <td></td>
        <td>
        
          <a href="#"    onclick="goPage();return true"><img  src="../../Images/printer.gif"></image></a>
        </td>
</tr>
</table>
                 </td>
                 <td>
                   <table align="left" >
            
            <tr>
                <td>
                    <asp:Button ID="anteriorButton" runat="server"  Text="Anterior"  OnClick="saveButton_Click" CssClass="ms-crm-List-Header" />
                </td>
                <td>
                    <asp:Button ID="siguienteButton" runat="server"  Text="Siguiente" OnClick="saveButton_Click" CssClass="ms-crm-List-Header" />
                </td>
            </tr>
        </table>  
                 </td>
                 </tr>
                 </table>
                </asp:Panel>
  <asp:Panel ID="PanelBody" runat="server" Visible="false" BackColor="white" >

      <input id="internalid" type="hidden" runat="server" />
      <input id="idObra" type="hidden"  runat="server"/>

      
                 <table width="900px" >
                <tr>
                <td >
      <table   >
          <tr>
              <td  align="right" width="100px"  >
                   &nbsp;Comparativo:</td>
              <td  width="350px" align="left">
                  <asp:HyperLink ID="comparativoLabel" runat="server" ForeColor="Blue"></asp:HyperLink>
              </td>
              <td  align="right" width="150px">
                   Moneda: </td>
              <td width="200px">
                  <asp:Label ID="monedaLabel" runat="server"></asp:Label>
              </td>
          </tr>
          <tr>
              <td  align="right">
                   &nbsp;Numero:</td>
              <td width="350px" >
                  <asp:Label ID="numeroLabel" runat="server"></asp:Label>
              </td>
              <td  align="right" width="150px">
                   T/C: </td>
              <td width="200px">
                  <asp:Label ID="tipoCambioLabel" runat="server"></asp:Label>
              </td>
          </tr>
          <tr>
              <td  align="right" valign="top">
                   &nbsp;Fecha:</td>
              <td width="350px" >
                  <asp:Label ID="fechaLabel" runat="server"></asp:Label>
              </td>
              <td  align="right" valign="top" width="150px">
                   Estado  </td>
              <td valign="top" width="200px">
                  <input id="idComparativo" type="hidden" runat="server" />
                  <asp:Label ID="estadoLabel" runat="server" Text="" Font-Bold="true"></asp:Label>
              </td>
          </tr>
          <tr>
              <td  align="right">
                   &nbsp;Proveedor:</td>
              <td width="350px" >
                  
                  <asp:HyperLink ID="proveedorTXT" runat="server" ForeColor="Blue">
                                   </asp:HyperLink>
              </td>
              <td  align="right" width="150px">
                   Partida: </td>
              <td width="200px">
                  
                  <asp:HyperLink ID="EstructuraLabel" runat="server" ForeColor="Blue"></asp:HyperLink>
              </td>
          </tr>
          <tr>
              <td  align="right">
                   &nbsp;Contacto:</td>
              <td width="350px" >
                  <asp:Label ID="proveedorContLabel" runat="server"></asp:Label>
              </td>
              <td  align="right" width="150px">
                   Centro Costo: </td>
              <td width="200px">
                  <asp:Label ID="centroCostoLabel" runat="server" Text=""></asp:Label>
              </td>
          </tr>
          <tr>
              <td align="right">
                   Forma Pago:</td>
              <td align="left" width="350px">
                  <asp:Label ID="formaPagoLabel" runat="server"></asp:Label>
              </td>
              <td align="right" width="150px">
                   &nbsp;Fecha Entrega:</td>
              <td width="200px" >
                  <asp:Label ID="fechaEntregaLabel" runat="server" Text=""></asp:Label>
              </td>
          </tr>
          <tr>
              <td align="right">
                  Tipo Gasto: </td>
              <td align="left" width="350px">
                  <asp:Label ID="tipoGastoLabel" runat="server"></asp:Label>
              </td>
              <td align="right" width="150px">
                  Autorizado:</td>
              <td width="200px">
                  <asp:Label ID="autorizadoLBL" runat="server" Text=""></asp:Label>
              </td>
          </tr>
          <tr>
              <td align="right">
                  Doc Ref:</td>
              <td align="left" width="350px">
                  <asp:HyperLink ID="RendicionCHK" runat="server" ForeColor="Blue" 
                      Visible="false"></asp:HyperLink>
              </td>
              <td align="right" width="150px">
                  Usuario Creacion:</td>
              <td width="200px">
                  <asp:Label ID="revisadoLabel" runat="server" Text=""></asp:Label>
              </td>
          </tr>
          <tr>
          <td align="right">
              Observaciones: 
          </td>
          <td colspan="3">
                <asp:Label ID="observacionLabel" runat="server" Text=""></asp:Label>
          </td>


         
          </tr>

      </table>
                 </td>
                 <td valign="top" width="150px" align="left">
                 
                 
    <table width="200px"   class="PanelTotales">
        <tr>
            <td align="right" width="50px" >
                 SubTotal: </td>
            <td align="right" width="100px">
                <asp:Label ID="subTotalLabel" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="right" width="50px" >
                 IGV: </td>
            <td align="right" width="100px">
                <asp:Label ID="igvLabel" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="right" width="50px" >
                 Total: </td>
            <td align="right" width="100px">
                <asp:Label ID="totalLabel" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
    </table>
    </td>
    </tr> 
    </table>

    <asp:TabContainer ID="TabContainer1" runat="server" Width="100%" 
          ActiveTabIndex="1">
        
        <asp:TabPanel ID="TabRecursos"    runat="server" HeaderText="Insumos" >
        <ContentTemplate>
            <asp:UpdatePanel ID="itemUpdatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
            <asp:GridView ID="itemOrdenCompraGridView" runat="server" CellPadding="4" 
            SkinID="GridView"
                ForeColor="#333333"  AutoGenerateColumns="False"
                ShowHeader="true"
                ShowHeaderWhenEmpty="true"
                >
                

                <Columns>
                <asp:BoundField DataField="codigo" headerText="CODIGO" />
                <asp:BoundField DataField="descripcion" headerText="DESCRIPCION" ItemStyle-Width="350px" />
                <asp:BoundField DataField="unidad" headerText="UNIDAD" />
                <asp:BoundField DataField="cantidadStr" headerText="CANTIDAD" HeaderStyle-Width="90px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N}" />
                <asp:BoundField DataField="precioNoIGVStr" headerText="PRECIO Unit." HeaderStyle-Width="90px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N}"/>
                <asp:BoundField DataField="precioInclIGVStr" headerText="PRECIO Unit."  HeaderStyle-Width="90px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N}"/>
                <asp:BoundField DataField="descuentoStr" headerText="DESC"  HeaderStyle-Width="90px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N}"/>
                <asp:BoundField DataField="subMontoStr" headerText="SUBTOTAL" HeaderStyle-Width="90px"  ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N}"/>
                <asp:BoundField DataField="IGVItemStr" headerText="IGV"  HeaderStyle-Width="90px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N}"/>
                <asp:BoundField DataField="subMontoIGVStr" headerText="TOTAL" HeaderStyle-Width="90px"  ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N}"/>
                                                                                          
                </Columns>
               

            </asp:GridView>
            </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
        </asp:TabPanel>

      

                <asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Facturacion" >
               <ContentTemplate>

               <table>
               <tr><td>
               </td></tr>
               </table>
                   <asp:LinkButton ID="nuevoFRLinkButton" runat="server"   ForeColor="Blue" >Nuevo FR</asp:LinkButton>

                    <br />
     <asp:GridView ID="documentoGridView"     AutoGenerateColumns="False"
                DataKeyNames="idInternal" Runat="Server" ShowHeader="true" ShowHeaderWhenEmpty="true"
                SkinID="GridView" CellPadding="4"  >
                       
                  <Columns>
                    <asp:HyperLinkField 
                        ItemStyle-Width="70px"  ItemStyle-ForeColor="Blue"
                        HeaderText="FR"
                        datatextfield="numRecepcion" 
                        datanavigateurlfields="idInternal,idObra"
                        DataNavigateUrlFormatString="~/ObraAdmin/RecepcionDoc/RecepcionDocReadForm.aspx?id={0}&idObra={1}"  />
                      <asp:BoundField DataField="fecha"   HeaderText="FECHA FR"  ItemStyle-HorizontalAlign="Right"  ItemStyle-Width="75px" DataFormatString="{0:d}"  />    
                      <asp:BoundField DataField="tipoDocumento"   HeaderText="T/D"/>
                      <asp:BoundField DataField="numDocumento"   HeaderText="NUM. DOCUMENTO" ItemStyle-HorizontalAlign="Right"/>
                      <asp:BoundField DataField="proveedor" HeaderText="PROVEEDOR"/>
                      <asp:BoundField DataField="netoStr"   HeaderText="SUBTOTAL"    ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="100px" />         
                      <asp:BoundField DataField="igvtotalStr"   HeaderText="IGV"   ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="100px"  />         
                      <asp:BoundField DataField="totalStr"   HeaderText="TOTAL"    ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="100px" />         
                      
                      <asp:BoundField DataField="fechaEmisionDocStr"     HeaderText="FEC. EMISION"  ItemStyle-Width="80px"   />      
                      <asp:BoundField DataField="fechaVencimientoDocStr" HeaderText="FEC. VENCI."  ItemStyle-HorizontalAlign="Right"  ItemStyle-Width="80px"   />      
                      
                  </Columns>
                
           
               </asp:GridView>
 

               </ContentTemplate>
               </asp:TabPanel>

                  <asp:TabPanel ID="TabPanel3" runat="server" HeaderText="Ingreso Almacen"  Font-Size="X-Small">
               <ContentTemplate>

        <asp:HyperLink ID="IngresoAlmacenButton" runat="server" ForeColor="Blue" 
            >Nueva Nota Ingreso</asp:HyperLink>
        

 

        <br />
        
 
 
         <asp:UpdatePanel ID="UpdatePanel1" runat="server"  UpdateMode="Conditional">
         <ContentTemplate>
         <uc5:NotaIngresoListGrid ID="NotaIngresoListGrid2" runat="server"
             
              DataSourceID="NotaIngresoListODS" />

             <asp:ObjectDataSource ID="NotaIngresoListODS" 
              runat="server"
             EnablePaging="True"
              SelectCountMethod="Count" 
              SortParameterName="sortExpression"
             SelectMethod="GetNotaIngresoList" 
             typeName="BOL.NotaIngresoBL" >
               <SelectParameters>
                 <asp:querystringparameter  Name="idOrdenCompra" Type="Int32" querystringfield="id"  />
                 <asp:Parameter Name="startRowIndex" Type="Int32" />
                 <asp:Parameter Name="maximumRows" Type="Int32" />
                 <asp:Parameter Name="sortExpression" Type="String" />

                </SelectParameters>
               </asp:ObjectDataSource>
         </ContentTemplate>
         <Triggers>
         <asp:AsyncPostBackTrigger ControlID="refreshButton" />
         </Triggers>
         </asp:UpdatePanel>
        

               </ContentTemplate>
               </asp:TabPanel>

        </asp:TabContainer>



                 </asp:Panel>
    
    </form>
</body>
</html>
